<template>
    <div id="overall">
        <p>这是一个全局组件</p>
        <button @click="clickEnent">全局组件的点击事件</button>
        <p>
            组件被点击的次数<span>{{count}}</span>
        </p>
    </div>
</template>
<script>
    export default {
        name: "overall",
        components: {},
        data() {
            return {
                count: 0
            };
        },
        methods: {
            clickEnent: function () {
                console.log('全局组件被点击');
                this.count++;
            }
        },
    };
</script>
<style scoped>

</style>